syntax = "proto3";

package thunderpb;
option go_package = "github.com/samsarahq/thunder/thunderpb";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

message Selection {
  string name = 1;
  string alias = 2;
  SelectionSet selection_set = 3;
  bytes arguments = 4;
}

message Fragment {
  string on = 1;
  SelectionSet selection_set = 2;
}

message SelectionSet {
  repeated Selection selections = 1;
  repeated Fragment fragments = 2;
}

message Query {
  string kind = 1;
  string name = 2;
  SelectionSet selection_set = 3;
}

message ExecuteRequest {
  Query query = 1;
}

message ExecuteResponse { bytes result = 1; }

service Executor {
  rpc Execute(ExecuteRequest) returns (ExecuteResponse) {}
} 